object IfElseExercise01 {
  def main(args: Array[String]): Unit = {
    test1(11, 111)
    test2(111.0, 111)
    test3(12, 3)
    test4(2000)
  }

  def test1(n1: Int, n2: Int): Unit = {
    if(n1+n2 >= 50){
      println("hello world")
    }
  }

  def test2(d1: Double, d2: Double): Unit  = {
    if (d1 > 1.0 && d2 < 20.0){
      println(d1 + d2)
    }
  }

  def test3(n1: Int, n2: Int): Unit = {
    var sum = n1+n2
    if (sum%3==0 && sum % 5 ==0){
      println(s"$n1+$n2 既能被三整除也能被五整除")

    }

  }

  def test4(year: Int): Unit = {
    if (year < 0) {
      println("请输入合理的年份")
    }else{
      if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
        println(s"$year 是闰年")
      }
    }


  }
}
